added logout and authentication.