cleand up error handling and removed commas from page name in csv