Added try-catch on file upload