code cleanup, ensured entire routine gets executed for each message received - this was buggy before with previous implementation