fixed sql scripts