fixed crash on resume