fixing bug with double extraction