Add timeout functionality