added -L flag for curl to follow redirect