Fixing bug on determining no valid moves