more keyerror fixes