fixed a critical crashing issue