fix a serious bug in fragment