reverted popitem check