updated process loop