added hasCollision