fixes problem with iterating over dictionary, ensures unicode to utf8-encoded strings