try to fix template nest if-s