improve saving attachment