solve segfault