fixed segmentation fault, because of uninitialized variable