Added check to avoid adding the JS file multiple times to the header.