removing environment before making ajax call