Added unavail and avail statements in start_thread