fixed afterSave hook which caused errors importing items using background scripts