When story cards' action button was pressed, the code to load the actions into the popup was sometimes being executed before the popup was even being render. So a quick work around was that a setTimeout function was placed around the code to inject the actions. A more proper approach would probably be to use the API to put actions on cards.
Refactroed