fix bug and add login