fix for sql mode