tweak copy and paste function