added message loop