add check for graphics mode vs. terminal mode