Fixing a crash bug