fixed segfault (wild pointer!)