Fixed a bug!

Corrected the condition in for loop!