fix for the segfault