preventing some key error exceptions