Added closeable thread

removed unneeded sys.exit(1)