modify cleanup thread for normal termination