got for-loop to work in template