Update to db queries