adding thread wait