fix sql script bug