detect system environment