Added code for daemonizing the application