Check for directory before creation.