fix overdue SQL