fixes #2 - a bug that prevented workers from finishing sometimes during shutdown