Fixed daemon taking long time to stop