directory check to avoid failure on dir exist.