better fixes. never call exits in a threaded program.