fixed check for empty message