Added check to prevent sending an empty list of recipients