move the js function to the config js file