proper synchronization of msg handling.