Working on fixing the segfault