fix usage of keys method