some cleaning up of callback