fixed tautological calculation of @main_dirs