change environment properly