fixed a nil exception