made the error_type  follow a singlenton pattern