add fn for state dir