Re-added in the timeout and removed the previous code that added complexity.