Fixed issue with scheduler