added isset check, fixed not printing out strictly nested template