correct error handling, still too complex