Fixed null pointer in onresume