Callback function getting clobbered