Updated R scrip to save the workspace image