fixing function definition