Fixing bug with order