handling dialogue switching