fixed issues with movement functions