1. A method for correcting overlay error on a substrate comprising: performing a measurement process in a metrology tool on a substrate to obtain a substrate distortion map or an overlay error map; determining doping parameters to correct overlay error or substrate distortion based on the substrate distortion map or the overlay error map; and providing a doping recipe to a doping apparatus based on the doping parameters determined to correct substrate distortion or overlay error.