Login work a little more (but still rather unstable)