adding fix for segfault