fixed while morning loop for procedure