fixed some bugs caused by not passing a file param to the upload_file method