fix key reference issues