Created error checking
Merge pull request #44 from Eduki/error_checking

Created error checking