KEY_BAD_TYPE error added