Added logic for daemons