modified for upload