fix typo that causes error when filteredElement is null
new function to wait for a given accessor to return a useful value before returning it