fix segmentation crash on ubuntu 12.04