fix segfault during compile