Added logout mechanism.