added dialog state listener for pause and resume state