before impl mainloop and test authetication state