fixed UI flickering during login