client side code fixed
server code added