some fix to segfault