Fix a bug on "segment fault"