saves the leaf before adding an attachment

Signed-off-by: Sam Heuck <sam@samheuck.com>
fixes bad reference to this

Signed-off-by: Sam Heuck <sam@samheuck.com>