Fixed "AttributeError" at message handler
Fixed crash files writer