adding finally block example for daemon and thread processes.