Added JS functionality