fixed bug when receiving improperly formatted mail