added volatile to _terminate flag