add js function
some modifies