Fixed nullpointer when Activity closed before Fragment