fix iteration over keys instead of values