fix bug on directory variable