updated exec to optionally echo