Seperate login from gui with thread.