Move functionality is working but not correctly