fix invalid movements