adding addtional stop case to while