fix small bug in detection collision