Support to run as daemon