Added isLogin function