dialog logic added