fix #25 thread callback is only called when end request is made