Is `$elem` defined here?