Added cleanupPreviousSession option