Please modify the script to save the extracted text as a file in the results subdirectory, that lives in the same directory as the script. Also add error handling please.