fix calculating bounds for collisions