catch errors when calling send
add comments