finalized uploading function again