fix problem that login block the ui thread