Set SP middleware in correct order with 404 error handler