handle null environment.