copied cp and scp changes from demo-portal-wizard-widgets