fix bug:add tail pointer