call next with err in middleware