Added safeguards around sending data