fix query mode