added more timeout functionality