Update templateWithQueue

added testing