fix two segfault points