fixed directoy and flag sorting for stdout promt