Fixing bug when last order