attempt to fix the CUSTOM_PTR macro