fixed a crashing error.