Fixed small bug with direction