Fixed a bug with checking existing items