adding basic error handling
Merge pull request #9 from obihann/errorHandling

adding basic error handling