Fix bug and add CommonQuery