added state object an creation of state for thread
added new attr