add js logic