Fix bug where variables not found in view