Added timeout support