Remove code which caused a crash on activity resume