correct rect collision detection