fix --state-file creation