fixed app hang when analytics is turned off

this pr needs back porting to 3.1.X