fix wrong access of keys