define main scheduler as daemon