cleanup after chat
error handling