added error handling to upload view