Fixed scheduler to use rake function instead of shelling out