Bugfixes the checking of dir availability