checking for errors in movement