fixed some collision detection bugs in reset function