updated the broken SQL