Adding wait_on_close=True to upload_local_file calls