add error handling/logging/tracing