fix a bug for memery null