Added duplicate check