Fixing a possible crash