add login and register handler