replaced prints by logger