fixed error in creating target directory