fix error with scheduler