fixed a SegmentFault.