fixes crash bug