fix for invalid moves