fixed some bugs, log in flow finished