Implementation of dialog