add login and small db functions