fixed bug where rare empty  messages crash program