Adding timeout feature