fix of mysql query