fix bug with key_string & reporting errors