Added further clause to checking for for-loop