key error patch