minor changes sql