Add timeout to lower CPU usage