Capturing More than one attribute from checkout.liquid

Hello,

We are Shopify Plus users and have checkout.liquid file activated as well. We have a code that captures the checkout attribute value for purchase order number on contact_information step, We are trying to implement one more field that will capture the date from shipping_method step. but when i implemented the code it is only capturing the one in the second stage and the first one doesnt get picked up. Unsure about what causes an error for this ? can someone gone through the same issue and used any special method , please let us know.

Code for the both the attributes are as follows :

if (Shopify.Checkout.step == 'contact_information'){
    
  //create text input variable
  	var input = 
        	'' +
				'
' +
      				'## ' +
          				'Purchase Order Number'+
      				'' +
    			'
' +

    			'' +
    				'
' +
    					'
' +
        					'' +
    					'
' +
    				'
' +
				'
';

    
                                       
    //append Purchase Order html content
	$(".section--contact-information:first").after(input);
    //listen for changes on the text input
    $("#checkout_purchase_order_number").change(function(){
  		var obj = $("#checkout_purchase_order_number").val();
      //store value in session storage
    	sessionStorage.setItem("purchase_order_number", obj);
	});
    //get the session storage value and display in text input
    var savedObj = sessionStorage.getItem("purchase_order_number");   
    if (savedObj !== null) {        
    $("#checkout_purchase_order_number").val(savedObj);
      
    }
    
  }

  if (Shopify.Checkout.step == 'shipping_method'){

    var shippingInput = 
        	'' +
				'
' +
      				'## ' +
          				'Shipping Date'+
      				'' +
    			'
' +

    			'' +
    				'
' +
    					'
' +
        					'' +
    					'
' +
    				'
' +
				'
';
  }