Fixed isValidMove Logic