fixed a bug that made Framework thread-unsafe