fixed an issue with the onresume and tos