fixed sqlalchemy issues