use document ready to fire the attachment