Fixed the threading errors again