I might be blind, but I don't see why this code would make any sense. It sets limit to unlimited if items equal to the current limit. So it triggers only when total = 0, 5, 10, 15, 20, 25, 30, 50, 100...