Fixed search bug, added db indexes