fix key function invocation