added generic support for stdClass