realize basic function login