changed warning to print using logging.warning