Fixed common error of executing controller more than once due to including it in multiple places in template