Update builder/and make middleware work properly