fix a possible crash issue