replaced ref.types.Object by 'pointer' to make lib work on event handler