add register, login, logout function