fixing bug with unshift