refactored code so that document selector is not in quotes