fix template filter bug