add synchronization between client and server