change js logic