save this pointer just before registering callback function