Updated reco script and added some error checking