Prevent illegal moves