automatically call 'attach' if the view is appended