corrected while check conditions in output manager