implement onsaveinstancestate for the dialog