fix some bug and transition