added next middleware