Added apn debugging code