modified toArray filter to include firebase index to fix the problems the original caused