Fix bug in ddKeyFunc