fix: error handling in extract()