Fixed bug with not selecting gen SQL