Fixing duplicate entries