changed dialog and add funcs