fixed a bug where view variables where not carried over to templates