Reduction of optical damage effects in LiNbO3 and LiTaO3