Fix possible bug in sender logic