fix crash: fetch attachment in local context