Added check for empty message