filter invalid movement commands