Added if Count != 0 check in template