working back/state back buttons