fixed the segfault!