fixed index controller logic to incoroporate logs