set state directory correctly