added duplicate prevention