template options now does middleware
bugfix