replaced print by logger