switched to using request module so redirects get handled