broke system cmds and exception response apart
added missing end to if block