wrote in exit condition