Fixed a segment fault