client side code fixed