fixed problem with directories with lots of children. fixes issue #4