Fixed the duplicate Javascript mess