Corrected function definition