updating client main loop