fix leak in message emission