More complex logic on launch and resume