changed to sqlalchemy style query