Fix issue on Service and Shutdown and improve FileMonitor