modified client and server side