issue #2771:  fix crash bug