updates to txt extraction. better eror handling