                 
                 dispatch_async(dispatch_get_main_queue(), {
                     self.actionTitle.text = action!.getTitle();
-                    self.behaviorTitle.text = action!.getBehaviorTitle();
+                    self.behaviorTitle = action!.getBehaviorTitle()
+                    self.behaviorButton.setTitle(action!.getBehaviorTitle(), forState: UIControlState.Normal)
+                    self.behaviorDescription = action!.getBehaviorDescription();
                     self.actionDescription.text = action!.getDescription();
                     self.masterContainer.addSubview(self.actionContainer);
                     self.masterContainer.addConstraints(self.actionConstraints);

    var upcomingAction: UpcomingAction? = nil;
    var notificationId: Int = -1;
    var mappingId: Int = -1;
    
    //UI components
    @IBOutlet weak var scrollView: UIScrollView!

                self.fetchReward();
            }
        };
    }
    
    @IBAction func displayBehaviorDetails(sender: AnyObject) {
        let alertController = UIAlertController(title: behaviorTitle, message: behaviorDescription, preferredStyle: .ActionSheet)

        // HACK for changing the style of alerts. NOte the coment about this being private API usage.
        // http://stackoverflow.com/a/26949674/182778
        // Doing the below also looks terrible.
        /*
        let paragraphStyle = NSMutableParagraphStyle()
        paragraphStyle.alignment = NSTextAlignment.Left
        
        let titleText = NSMutableAttributedString(
            string: behaviorTitle.text!,
            attributes: [
                NSParagraphStyleAttributeName: paragraphStyle,
                //NSFontAttributeName : UIFont.preferredFontForTextStyle(UIFontTextStyleTitle1),
                //NSForegroundColorAttributeName : UIColor.darkGrayColor()
            ]
        )
        
        let messageText = NSMutableAttributedString(
            string: behaviorDescription,
            attributes: [
                NSParagraphStyleAttributeName: paragraphStyle,
                //NSFontAttributeName : UIFont.preferredFontForTextStyle(UIFontTextStyleBody),
                //NSForegroundColorAttributeName : UIColor.darkGrayColor()
            ]
        )
        alertController.setValue(messageText, forKey: "attributedMessage")
        alertController.setValue(titleText, forKey: "attributedTitle")
        */
        
        // Wire up OK action and present the alert.
        let OKAction = UIAlertAction(title: "OK", style: .Default) { (action) in
            // OK doesn't do anything.
        }
        alertController.addAction(OKAction)
        
        self.presentViewController(alertController, animated: true) {
            // Neither does presenting the alert.
        }
    }
    
    private func fetchCategory(categoryId: Int){
