modified print method