converted to jquery from node client side