Revert "use hGetAll instead of hKeys and foreach"

This reverts commit 2ebaf58b76cd1a836b719ad91476bb574572de1e.