created a syslog and improved debugging