overriding the dir function