used dictionary key safely, fixes #548