fixed crash when user switches from backscreen to frontscreen