fix bug related to scheduling and bucket scans