add register login function