Added collision detection while moving