fixed a crash bug reported on 3.6.3