Added logging statements to assist with debugging