attempted to fix segfault issue