Move check for include spaces outside the loop