corrected collision check