some bugs from switching to array db results