fix for #411 copy/paste crash