Fixed error when not selecting to gen SQL