added status argument and a state file