changed some prints to syslog