fix tests keyerror