Fixing onresume sensor bug