fixed a crash bug