Added $item to check for template file.