better error handling
docs