added error checking on sysarg