added error handling for items not found