Restore deleted clearSelected function