Add code to turn into daemon when required.