Fix  a bug cause program crash