added check for existing files when downloading books