Added Service State

Now waits for the previous thread to finish before starting another
thread.