change print statements to logging debug