Fixed a possible crash