improved send design and added input validation