Fixed a crash bug