change to global api
fix logic on assign preFileDir