Fix query blank bugs