add login and poll functions