added code to error handling
Merge pull request #13 from voidabhi/errorHandling-code

added code to error handling