Add env script and make work with CM 4.6