replaced console with logger