register and authentication almost complete