move where ExitOnError is defined
account for missing params