support attaching in a background thread
add some error handling to the attachment