improved CSS and JS check to avoid duplicate linking of the files