Added check for ended game if there is no move possible