modified to use Yoke middleware