fix worker memory leaks