fixed some bugs in validating a movement