modified source files and error reporting
Merge pull request #73 from Ricky1833/master

modified source files and error reporting