Started to implement global error handler