changed checkCollision