errors fixes and add delete for deleted items