put uploading before actual upload