fix problem with inconsistent readdirs