added check for allowing empty subject for email