added redirect on logout.
added check on init to do testconnection.