fix for upload file function