add tests and update uploading