Fixed sqla state extraction