fix error in sql script