properly return exit code from shell()