adding try/catch statements
Merge pull request #459 from shahit2/TryCatch1255

adding try/catch statements