Callback and stoping thread