overhauled button pressed backStack behaviour...use a JS callback to let it work with JS calls