combining exit methods so they get called and adding ability to pass onExit from parent to child process