added use of exitcode in execcommand, removed odd exception handling