Fix to Flask-SQLAlchemy