Added option for timeout