better handling coming back from background