fixes for terminal mode