yes, it should work without `.keys()`, it is also faster and it avoids generating a temporary list. 
What error do you have if you remove it ?