fixed some bug and auth