Fix bug IllegalState from Fragment