fixed a crashing issue