updating use of SQLAlchemy