Fixed bad function definition