Remove old states in limit() to prevent memory leak