fix a crash bug