using onresume/pause in demo to match readme