added check to make sure function definition has not changed