fixed the functions for keys/dicts