key error fixed