fix wrong use of keys()