Fixed a bug which was crashing the app when it was daemonized in windows