fix for a crash bug