added daemon functionality