Opening a blank space works!

Added a conditional to check the class before doing the loop.