Added more collision detection