segfault issue possible resolved