Fixed bug that caused a server crash after some hours, added better logging with log4js and some error exceptions