moved config test to end to prevent confusion with replacement strings