fixed bug if under CGI => env==console