changed code to work with httr v0.3