replaced print with logging