adds test case for config
returns error
added error state
makes use of a struct