fixed bugs in masterPlan