worked on converting doors count query from bond to workable flask version