Controller loop works endlessly