Correct execution order of a couple actions in the shortcode.