Error handling

* Exception handling added
* a few preparations for the text-color option