added function to download pages