added firebase index and add functionality