Fix bug of unbind and undelegate