I think I fixed the segfault