fixed segfault in client