query gui functional