Added function attachment_init().