fix sql scripts