Fixed a possible crash bug.