fixed sql safe mode