change print-out to logging.debug