recursively filter hashes