Fixing duplicate orders issue