Fixed a possible concurrent modification exception bug
Fixed significant bug on the control of discovery plan