Improve stale element handling