updating use of sqlalchemy