fixed looping error
Fixed looping error