fix a keyerror