changed error's inherits
refactored error handler middleware
refactor next(err)