replaced urllib2 with requests module