Fixed sql mistake