created before and after for dialogs