add plan or not plan and some other changes