added error handling for IOerror on upload