fix studio query bugs