per code review, adding null pointer checks within the callbacks, just in case