added missing controller logic