fixing bug with removing fragments