fix a bug of sqlalchemy