fix empty message and send message only if something is to be send