Added check for non-zero loength exit file