added error handling pages and logic to upload #7