added mode and persist options
added the persist option