fix possible missing directories