check for existence of directory before creating it