added support to manage attachment locally