Implemented timeout feature