Add the start of better error handling