fix bug for first dir