fix register bug and transition bug