Fixed: reordered code blocks to remove expired optimistic