handle return codes from system() calls