fix a possible crash cause