fix application controller logic