made change for code review feedback: update for message loops
made changes for code review feedback: update for message loops