refactor run method to stop threads dying on return.