refreshing vapptemplate in while loop