add error handling to send