fixed error handler, remove ugly error