fix some keyerror