pretty sure i fixed segfault error now