Adding debug statements to payload handler