added console app handling