Ethan: Fixed sql script