fix many crashes.