fixed duplication bug partially