fixed bug in creating directory