fixed errors in client_main