refactor: better error printing