Fixed SQL error on prod