Fix issue with stopping daemon