added running as daemon option