check create directory first

check create directory first