fix key handling
add test for config