still fixing the segfault bug