mod optimize query when not debugging, add /first option