added daemon basic code