added env checking method