fix $main not being available in lazy view rendering. closes #1519