Fix a possible crash