fixed controller logic