handing all-zero row in A case