added extract and return value of previous command