add function login, register