added timeout handler