added redirect flag for curl