added saving and loading of pkgs