client side logic