Fix homepage condition for template matching