Adding more error handling to uploads