added error handler and visual representation