function definition was failing