fix a key error and mines!