created a function for restarting the acceptor thread when it hangs