fixed the --wrap switch testing and execution