Add timeout for checking output