Well the problem was/is that line 94 gets concated with line 98 when $enableipmonitoring is enabled.
 With the addition of the explicit \n this is solved. any better or cleaner way to add a new line is welcome.