correct error infinite while loop end_turn