adjusted clearing thread-specific handler chain