THIRD AMENDMENT TO CREDIT AGREEMENT and first amendment to security agreement