make S3 class work