Fixed bug in view.tpl