Added try catch block when uploading file and added comments