replaced print by logging