the javascript is running twice