fixed examples to use dirname