(wip) fix segmentation fault, and run correctly!