Added callback for collision detection