fixing save_as function for shared cases