added check existing login and also logout