refactor,fix signin problem