fixing empty results in template