Changed way fragment is removed to fix IllegalStateException bug