fix a bug
query more flexible