added support for userdata