fixed scoping in index template