pacakge: fix memory issue with uploading packages