fixed basic collision detection