added duplicate entry check