removed warning about strings matched against booleans. removed unused local variable currentThread