Small sql fix