improved filter to avoid duplicate loading of CSS and JS files