fixed sitemap creation logic