crude structure of login and registe process, still err when logging in