Update templateWithQueue

added call to main function