added support for detached console