added support for custom class