Fixed issue with scheduler usage