keyerror fix