handle_collision method updated