add attachment edit hook to file replace