fixed the duplicate addition bug