fixed error handling, added colors