updates error handling and to_string messages