get return code from previous command