fix messaging thread functionality