fixed a nil-pointer