dialog stuff and fixing back buttons