add missing error handling