fix a possible crash