Updated mode selection
added persistence for last good ip address and port
added persistence for last good ip address and port