Update condition of the end