fix segfault caused by previous fix!