Finalized solveing the duplicate bug