fixed a possible crash