Added check to prevent duplicate warning messages displaying.