add missing } before while