client side code now fixed