fix infinite message loop