added duplicate insert prevention