fixed error in print method