modified for curl script.