fixed sg fault