Fixed ANR when going into background