client side code