added mongo duplicate check