bugfix with duplicated items