Fixed bug of java script loading multiple times

bit of a work around