Fixed looping issue.