fit login function.