handle collisions when resizing