updated monitoring module and fixed server closure