small correct SQL to custom patch 1