implemented printing message to console