worked on linux build, still segfaults