Fixing duplicate check