fix for incorrect case sensitivity in loops