refactoring to be more idempotent

- also throw exception if you upload without a package being created