Fix type and modify proccess of building env
Update for latest Manager