fixed message delivery bug