state can be nil