Fixed bug in planManager