Fixed moving near edges bug

all is correct now